<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="${pageContext.request.contextPath}/statics/js/jquery-1.8.3.js"></script>
<script>
   function getNameBycardID(txtID,flag){
	   var cardID=$(txtID).val();
	   if(cardID.length==19){
		   $.post("getBankByCardID",{"cardID":cardID},function(res){
			   if (res!=null&&res!=undefined) {
				   if (flag==1) {
					   $("#spFromName").html(res.customerName);
				   }else if(flag==2){
					   $("#spToName").html(res.customerName);
				   }
				   $("#btnTran").attr("disabled",false);
			   }else{
				   $("#btnTran").attr("disabled",true);
			   }
		   },"JSON");
	   }
   }
</script>
<style type="text/css">
  span{
   font-size: 18px;
   font-weight: bold;
  }
</style>
</head>
<body>
   <h2>${tranMessage}</h2>
   <form action="transfer" method="post">
       <p>扣减账户卡号：<input name="fromCardID" onchange="getNameBycardID(this,1)" value="${fromCardID}" size="30" />
          <span id="spFromName"></span>
       </p>
       <p>转账金额：<input name="account" /><input type="submit" id="btnTran"  value="==转账-->"/></p>
       <p>转入账户卡号：<input name="toCardID" onchange="getNameBycardID(this,2)" value="${toCardID}" size="30" />
       	 <span id="spToName"></span>
       </p>
   </form>
</body>
</html>